package com.yonyou.cyxdms.sysAuth.service.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.sysAuth.service.entity.PermissionCtrlPO;
import com.yonyou.cyxdms.sysAuth.service.vo.user.QueryMCVO;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 受控权限表 Mapper 接口
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
public interface PermissionCtrlMapper extends SuperMapper<PermissionCtrlPO> {


    /**
     * @description：菜单控制权限
     * @author ：maxingjian
     * @date ：Created in 2019/7/10
     * @modified By：
     */
    List<QueryMCVO> queryMCtrl(@Param("permissionType") Integer permissionType, @Param("params") Map<String, Object> params);

    void updatePermissionCtrl(@Param("isEmpowered") Integer isEmpowered, @Param("permissionId") Integer permissionId, @Param("ctrlCode") String ctrlCode, @Param("permissionType") Integer permissionType);

    List<Map<String, Object>> selectPermissionCtrlId(@Param("permissionId") Integer permissionId, @Param("permissionType") Integer permissionType, @Param("type") Integer type);

    List<Map<String, Object>> selectPermissionCtrlIds(@Param("permissionType") Integer permissionType,@Param("permissionId") Integer permissionId, @Param("ctrlCode") String ctrlCode, @Param("type") Integer type);

    void deletePermissionCtrl(@Param("id") Integer id);

    List<Map<String, Object>> queryMenuCtrl(@Param("permissionType") Integer permissionType, @Param("list") List<String> list, @Param("isEmpowered") Integer isEmpowered);

    void insertCtrl(@Param("ctrlCode") List<String> ctrlCode, @Param("type") Integer type, @Param("userOrgId") Long userOrgId, @Param("appId") String appId, @Param("userId") Long userId);

    void deletePermissionCtrlByUserOrgId(@Param("userOrgId") Long userOrgId);

    void addUserPermissionCtrl(@Param("userOrgId") Long userOrgId, @Param("roleIds") List<Long> roleIds, @Param("userId") Integer userId, @Param("appId") String appId);

    void deletePermissionCtrlByRoleId(@Param("roleId") Long roleId);

    void insertRoleCtrl(@Param("ctrlCode") List<String> ctrlCode, @Param("type") Integer type, @Param("roleId") Long roleId, @Param("appId") String appId, @Param("userId") Long userId);
}
